package behavior.strategy;

/**
 * 结合工厂模式 + 策略模式 实现策略工厂
 */
public class ActionStrategyFactory {
    public static ActionStrategy getActionStrategy(String type) {

        switch (type) {
            case "attack":
                return new AttackStrategy();
            case "retreat":
                return new RetreatStrategy();
            case "defense":
                return new DefenseStrategy();
            default:
                return null;
        }

    }
}
